#include <iostream>
#include <cmath>

using namespace std;

/*
【题目230】应用抽象类，求圆、圆内切正方形和圆外切正方形的面积和周长。
*/

class Shape
{
public:
    Shape(double r) : r(r), pi(3.14) {}
    virtual double GetArea() = 0;
    virtual double GetPerim() = 0;

protected:
    double r;
    double pi;
};

class Circle : public Shape
{
public:
    Circle(double r) : Shape(r) {}
    double GetArea() { return pi * r * r; }
    double GetPerim() { return 2 * pi * r; }
};

class inCircle : public Circle
{
public:
    inCircle(double r) : Circle(r) {}
    double GetArea() { return r * r * 2; }
    double GetPerim() { return r * 4; }
};

class outCircle : public Circle
{
public:
    outCircle(double r) : Circle(r) {}
    double GetArea() { return r * r * 4; }
    double GetPerim() { return r * 8; }
};

int main()
{
    Circle c(3);
    inCircle ic(3);
    outCircle oc(3);

    cout << "Circle Area: " << c.GetArea() << endl;
    cout << "Circle Perim: " << c.GetPerim() << endl;
    cout << "inCircle Area: " << ic.GetArea() << endl;
    cout << "inCircle Perim: " << ic.GetPerim() << endl;
    cout << "outCircle Area: " << oc.GetArea() << endl;
    cout << "outCircle Perim: " << oc.GetPerim() << endl;
}